package com.sddf.system.mode.dto;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;

@Data
@ApiModel("用户注册DTO")
public class UserRegisterDto {

    @NotBlank(message = "手机号不能为空")
    @Pattern(regexp = "^((13[0-9])|(14[5,7])|(15[0-3,5-9])|(17[0,3,5-8])|(18[0-9])|166|198|199|(147))\\d{8}$",message = "手机号不合法")
    @ApiModelProperty("手机号")
    private String phone;

    @NotBlank(message = "密码不能为空")
    @ApiModelProperty("密码")
    @Pattern(regexp = "^.{6,10}$",message = "密码必须是6-10位")
    private String pwd;

    @NotBlank(message = "用户名不能为空")
    @ApiModelProperty("用户名")
    private String userName;
}